package material.iteratorAndComponent.component;

public class MenuTestDriver {
    public static void main(String[] args) {
        /**
         * 先创建所有的菜单对象
         */
        MenuComponent pancakeHouse = new Menu("煎饼屋", "早餐");
        MenuComponent dinerMenu = new Menu("午餐厅", "午餐");
        MenuComponent cafeMenu = new Menu("咖啡厅", "晚餐");
        MenuComponent dessertMenu = new Menu("甜品屋", "饭后甜点");
        /**
         * 创建一个顶层菜单
         */
        MenuComponent allMenus = new Menu("All MENUS", "All menus combined");
        /**我们使用组合的add()方法，将每个菜单都加入到顶层菜单的allMenus中**/
        allMenus.add(pancakeHouse);
        allMenus.add(dinerMenu);
        allMenus.add(cafeMenu);
        allMenus.add(dessertMenu);
        /**
         * 加入菜单项
         */
        /*pancakeHouse菜单项*/
        pancakeHouse.add(new MenuItem("K&amp;B煎饼早餐", "煎饼、炒蛋和吐司", true, 2.99));
        pancakeHouse.add(new MenuItem("普通煎饼早餐", "煎饼、煎蛋、香肠", false, 2.99));
        pancakeHouse.add(new MenuItem("蓝莓煎饼", "用新鲜蓝莓做成的煎饼", true, 3.59));
        pancakeHouse.add(new MenuItem("华夫饼干", "蓝莓或草莓冰", true, 3.59));
        /*dinerMenu菜单项*/
        dinerMenu.add(new MenuItem("素食BLT", "培根配生菜和西红柿小麦", true, 2.99));
        dinerMenu.add(new MenuItem("BLT", "全麦培根配生菜和番茄", false, 2.99));
        dinerMenu.add(new MenuItem("汤", "今天的汤，配一份土豆沙拉", false, 2.99));
        dinerMenu.add(new MenuItem("热狗", "一个热狗，配沙罗，调味品，洋葱，用奶酪调味", false, 3.05));
        /*cafeMenu菜单项*/
        cafeMenu.add(new MenuItem("Vegggie Burger and Air Fries", "tomato fries", true, 3.99));
        cafeMenu.add(new MenuItem("Soup the day", "with side salad", false, 3.69));
        /*dessertMenu菜单项*/
        dessertMenu.add(new MenuItem("苹果派", "苹果派，有片状外壳，上面有香草冰淇淋", true, 1.69));
        /**
         * 一旦我们将整个莱单层次构造完毕把它整个交给女招待
         * 你会发现,女招待要将整份菜单打印出来,简直就是易如反掌
         */
        Waitress waitress = new Waitress(allMenus);
        waitress.printMenu();
    }
}
